#ifndef MOTOR_H_
#define MOTOR_H_

#include "msp.h"


#define MOTOR_PWM_PERIOD (127 << 7) // Because max "speed" is 127, this is the maximum value that PWM will count to
/**
   initialize motors initializes the motor subsystem by setting the correct registers for timerA to utilize 
   pwm output and set the motors to off. Call this command before setting motor speed.
*/
void initialize_motors();
/**
   set motor speed takes three values in the range of -127(max reverse) to 127(max forward)
   and sets the motor speed for the corresponding motor. 
   
   @param left - a value from -127 to 127 that corresponds to the speed of the left  motor
   @param right - a value from -127 to 127 that corresponds to the speed of the right motor
   @param vert - a value from -127 to 127 that corresponds to the speed of the vertical motor.
   however, the verical motor speed has only three states, forward, reverse and off, because of bugs 
   with timera and uart functionality.
*/
void set_motor_speed(int8_t left, int8_t right, int8_t vert);

#endif /*MOTOR_H_*/
